package com.zzf.demo.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import javax.xml.crypto.Data;
import java.util.Map;

public class ExcelListener extends AnalysisEventListener<DemoData> {

    //一行一行读取Excel中的内容
    @Override
    public void invoke(DemoData demoData, AnalysisContext analysisContext) {
        System.out.println("表数据"+ demoData);
    }

    //读取表头的方法
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        super.invokeHeadMap(headMap, context);
        System.out.println("表头"+ headMap);
    }

    //完成之后执行方法
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
